package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.mvp.contract.WXEntryContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;

import java.util.Map;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-31 16:27
 * 文件名: WXEntryModelImpl
 * 描述:
 */
public class WXEntryModelImpl extends BaseModelImpl implements WXEntryContract.Model {
    @Override
    public void mAccessToken(Observer<ResponseBody> observer, String url, Map<String, Object> parms) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).wxAccessToken(url, parms);
        doHttp(observer,observable);
    }

    @Override
    public void mWxLogin(Observer<ResponseBody> observer, String openid) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).wxLogin(openid);
        doHttp(observer,observable);
    }
}
